package cn.edu.cug.cs.gtl.oi.ui.menu;

import javax.swing.*;
import java.awt.event.KeyEvent;

public class JMenuGraphicEdit extends JMenu {
    JMenuItem ItemMouseTrans = new JMenuItem("鼠标平移");
    JMenuItem ItemPreciseTrans = new JMenuItem("精确平移");
    JMenuItem ItemMouseTransX = new JMenuItem("鼠标平移-沿X轴");
    JMenuItem ItemMouseTransY = new JMenuItem("鼠标平移-沿Y轴");
    JMenuItem ItemMouseTransZ = new JMenuItem("鼠标平移-沿Z轴");
    JMenuItem ItemObjChange = new JMenuItem("对象修改");
    JMenuItem ItemColorChange = new JMenuItem("颜色统改");
    JMenuItem ItemPropChange = new JMenuItem("属性统改");
    JMenuItem ItemObjProp = new JMenuItem("对象属性");
    JMenuItem ItemEqualScaling = new JMenuItem("等比缩放");
    JMenuItem ItemFreeScaling = new JMenuItem("自由缩放");
    JMenuItem ItemSpinSelectObj = new JMenuItem("旋转选中对象");
    JMenuItem ItemShowNormal = new JMenuItem("显示面/体法线");
    JMenuItem ItemClearNormal = new JMenuItem("清除面/体法线");
    JMenuItem ItemReversalNormal = new JMenuItem("反转面/体法线");
    JMenuItem ItemClearRepeatPoint = new JMenuItem("清除重复点");
    JMenuItem ItemTopStructDisposal = new JMenuItem("拓扑结构整理");
    JMenuItem ItemNormalDisposal = new JMenuItem("法线一致性调整");
    JMenuItem ItemSmoothShow = new JMenuItem("面/体光滑显示");

    public JMenuGraphicEdit() {
        this.setText("图形编辑(A)");
        this.setMnemonic(KeyEvent.VK_A);
        init();
    }

    void init() {
        ItemMouseTrans.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, 0));
        ItemMouseTrans.setEnabled(false);
        this.add(ItemMouseTrans);

        ItemPreciseTrans.setEnabled(false);
        this.add(ItemPreciseTrans);

        ItemMouseTransX.setEnabled(false);
        this.add(ItemMouseTransX);

        ItemMouseTransY.setEnabled(false);
        this.add(ItemMouseTransY);

        ItemMouseTransZ.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, 0));
        ItemMouseTransZ.setEnabled(false);
        this.add(ItemMouseTransZ);
        this.addSeparator();

        ItemObjChange.setEnabled(false);
        this.add(ItemObjChange);

        ItemColorChange.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, 0));
        ItemColorChange.setEnabled(false);
        this.add(ItemColorChange);

        ItemPropChange.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_G, 0));
        this.add(ItemPropChange);

        ItemObjProp.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, 0));
        ItemObjProp.setEnabled(false);
        this.add(ItemObjProp);
        this.addSeparator();

        ItemEqualScaling.setEnabled(false);
        this.add(ItemEqualScaling);

        ItemFreeScaling.setEnabled(false);
        this.add(ItemFreeScaling);

        ItemSpinSelectObj.setEnabled(false);
        this.add(ItemSpinSelectObj);
        this.addSeparator();

        ItemShowNormal.setEnabled(false);
        this.add(ItemShowNormal);

        ItemClearNormal.setEnabled(false);
        this.add(ItemClearNormal);

        ItemReversalNormal.setEnabled(false);
        this.add(ItemReversalNormal);
        this.addSeparator();

        this.add(ItemClearRepeatPoint);

        this.add(ItemTopStructDisposal);

        this.add(ItemNormalDisposal);
        this.addSeparator();

        ItemSmoothShow.setEnabled(false);
        this.add(ItemSmoothShow);
    }
}
